// 过程化-模块化
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

// 创建路由实例
const router = new VueRouter({
    routes: [{
            path: "/",
            redirect: { name: "Home" },
        },
        {
            path: "/Home",
            name: "Home",
            component: () =>
                import ("@/views/Home/Home.vue"),
            meta: {
                TabbarShow: true, // 需要显示 底部导航
            },
        },
        {
            path: "/CarList",
            name: "CarList",
            component: () =>
                import ("@/views/Car/CarList.vue"),
            meta: {
                TabbarShow: true, // 需要显示 底部导航
            },
        },
        {
            path: "/NewsList",
            name: "NewsList",
            component: () =>
                import ("@/views/News/NewsList.vue"),
            meta: {
                TabbarShow: false, // 不需要显示 底部导航
            },
        },
        {
            path: "/NewsDetial/:id",
            name: "NewsDetial",
            component: () =>
                import ("@/views/News/NewsDetial.vue"),
            meta: {
                TabbarShow: false, // 不需要显示 底部导航
            },
        },

        {
            // 商品展示
            path: "/GoodsList",
            name: "GoodsList",
            component: () =>
                import ("../views/Goods/GoodsList.vue"),
            meta: {
                TabbarShow: false, // 不需要显示 底部导航
            },
        },
        {
            // 商品详情
            path: "/GoodsDetial/:id",
            name: "GoodsDetial",
            component: () =>
                import ("../views/Goods/GoodsDetial.vue"),
            meta: {
                TabbarShow: false, // 不需要显示 底部导航
            },
        },
        {
            // 图文介绍
            path: "/GoodsDesc/:id?",
            name: "GoodsDesc",
            component: () =>
                import ("../views/Goods/GoodsDesc.vue"),
            meta: {
                TabbarShow: false, // 不需要显示 底部导航
            },
        },
        {
            // 图文介绍
            path: "/goodsComment/:id?",
            name: "goodsComment",
            component: () =>
                import ("@/views/Goods/goodsComment.vue"),
            meta: {
                TabbarShow: false, // 不需要显示 底部导航
            },
        },
        {
            path: '/ImgList',
            name: 'ImgList',
            component: () =>
                import ('@/views/Images/ImgList.vue'),
            meta: {
                TabbarShow: false // 不需要显示 底部导航
            }
        },
        {
            path: '/ImgDetial/:id',
            name: 'ImgDetial',
            component: () =>
                import ('@/views/Images/ImgDetial.vue'),
            meta: {
                TabbarShow: false // 不需要显示 底部导航
            }
        },
    ],
});

export default router;